package com.tesis_2.UI;

import com.example.tesis_2.R;
import com.example.tesis_2.R.layout;
import com.example.tesis_2.R.menu;
import com.tesis_2.Utils.LocalesCategoryAdapter;
import com.tesis_2.Utils.RestaurantsCategoryImageAdapter;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.AdapterView.OnItemClickListener;

public class LocalesCategory extends Fragment {

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
             Bundle savedInstanceState) {
	// Inflate the layout for this fragment
	View V = inflater.inflate(R.layout.activity_locales_category, container, false);
	GridView grid = (GridView)V.findViewById(R.id.gvBase_locales_category);
	grid.setAdapter(new LocalesCategoryAdapter(this.getActivity().getApplicationContext()));
	
	
	grid.setOnItemClickListener(new OnItemClickListener() {
		public void onItemClick(AdapterView<?> parent, View v,
			int position, long id) {
			
			Intent intent = new Intent(getActivity().getApplicationContext(), LocalesDetail.class);
			intent.putExtra("nRest", position);
			startActivity(intent);
		}
	});

	
	return  V;
	
	}

}
